package com.global.domain;

import java.util.ArrayList;
import java.util.List;

import com.global.emc.core.CoreAuthority;

/**   
 *  
 * @Description:  [交易]   
 * @Author:       [Joly_Huang]   
 * @CreateDate:   [2014年3月18日 上午10:38:23]   
 * @UpdateUser:   [Joly_Huang]   
 * @UpdateDate:   [2014年3月18日 上午10:38:23]   
 * @UpdateRemark: [说明本次修改内容]  
 * @Version:      [v1.0] 
 *    
 */
public class Authority implements CoreAuthority {
	
	private int id;
	private String authorityName;
	private Authority parentAuthority;
	private List<Authority> subAuthorities = new ArrayList<Authority>();
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getAuthorityName() {
		return authorityName;
	}
	public void setAuthorityName(String authorityName) {
		this.authorityName = authorityName;
	}
	public Authority getParentAuthority() {
		return parentAuthority;
	}
	public void setParentAuthority(Authority parentAuthority) {
		this.parentAuthority = parentAuthority;
	}
	public List<Authority> getSubAuthorities() {
		return subAuthorities;
	}
	public void setSubAuthorities(List<Authority> subAuthorities) {
		this.subAuthorities = subAuthorities;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Authority other = (Authority) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
	
	@Override
	public String toString() {
		return "Authority [id=" + id + ", authorityName=" + authorityName + "]";
	}

}
